import http from "@/utils/http.ts";

const chat = {
    // 发送消息
    sendMessage: (data: any) => {
        return fetch('/ai/chatStream', {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(data)
        });
    },
    // 清除历史消息
    clearHistory: (data: any) => {
        return http.get("/ai/clearContext" + "?userId=" + data);
    }
}

export default chat;